package com.example.mybaties.testone.bean_process;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * 主要是用来测试BeanPostProcessor的生命周期
 */
public class MyBeanPostProcessor2 implements BeanPostProcessor {

    private Logger logger = LogManager.getLogger(this.getClass());

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        logger.debug("MyBeanPostProcessor2..............Before...........postProcessBeforeInitialization()");
        return null;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        logger.debug("MyBeanPostProcessor2............After...........postProcessAfterInitialization()");
        return null;
    }
}
